package com.fy56.platform.logistics.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fy56.platform.logistics.common.AbstractModel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * Created by lml on 2018/2/25.
 */
public class Order extends AbstractModel implements Serializable {

    /**
     * 支付用户手机号码
     */
    private String mobile;

    /**
     * 运费金额
     */
    private String transportCost;
    /**
     * 运费是否支付(transportCostIsPay)(YES/NO)
     */
    private String transportCostIsPay;
    /**
     * 运费退款状态
     */
    private String transportCostRefundStatus;
    /**
     * 运费退款金额
     */
    private String transportCostRefundMoney;
    /**
     * 运费支付时间
     */
    private String transportCostPayTime;
    /**
     * 运费退款时间
     */
    private String transportCostRefundTime;

    /**
     * 差价支付金额
     */
    private String priceDifferences;
    /**
     * 差价是否支付(priceDifferencesIsPay)(YES/NO)
     */
    private String priceDifferencesIsPay;
    /**
     * 差价退款状态
     */
    private String priceDifferencesRefundStatus;
    /**
     * 差价退款金额
     */
    private String priceDifferencesRefundMoney;
    /**
     * 差价退款时间
     */
    private String priceDifferencesRefundTime;
    /**
     * 插件支付时间
     */
    private String priceDifferencesPayTime;

    /**
     * 查额
     */
    private String hBackupMoney1;



    private List<PayOrder> payOrders;

    private String orderBillMasterId;

    private String openid;  //用户openId
    private String orderNumber;//票号
    private String goodsNumber;//货号
    private String manualNumber;//手工单号
    private String tenantId;//租户ID
    private String tenantCode;//租户编码
    private String pickUpWay;//提货方式
    private String receiver;//收货人
    private String receiverMobile;//收货人手机
    private String receiverAddress;//收货人地址
    private String goodsName;//货物名称
    private Integer numberOfGoods;//件数
    private Double collectionOfMoney;//代收货款
    private String packageType;//包装
    private String remarks;//备注
    private String sender;//发货人
    private String senderMobile;//发货人手机
    private String senderAddress;//发货人地址
    private String senderIdNo;//发货人身份证
    private String receiverIdNo;//收货人身份证

    private String transferCompanyCode;     //中转公司编码
    private String transferCompanyName;     //中转公司名称

    private String hBackupString1;     //承运物流
    private String hBackupString4;     //指定物流
    private String hBackupString5;     //车辆类型
    private String hBackupString6;     //配送类型
    private String transportMode;     //运输方式
    private String waitNoticeGive;//等通知放货

    private String openId;

    private String uploadFlag;
    protected Date uploadTime;

    public String getWaitNoticeGive() {
        return waitNoticeGive;
    }

    public void setWaitNoticeGive(String waitNoticeGive) {
        this.waitNoticeGive = waitNoticeGive;
    }

    public String getUploadFlag() {
        return uploadFlag;
    }

    public void setUploadFlag(String uploadFlag) {
        this.uploadFlag = uploadFlag;
    }

    public Date getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Date uploadTime) {
        this.uploadTime = uploadTime;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getCodeCompany() {
        return codeCompany;
    }

    public void setCodeCompany(String codeCompany) {
        this.codeCompany = codeCompany;
    }

    /**
     * 经度
     */
    private Double senderLongitude;

    /**
     * 纬度
     */
    private Double senderLatitude;

    private String bankName;//开户银行
    private String bankCardNumber;//银行账号
    private String bankAccount;//开户人
    private String vipNumber;//一卡通号
    private Double weight; //重量
    private Double bulk;//体积
    private String payWay;//付款方式
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date orderCreateTime;//开票日期
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date orderUpdateTime;//产生时间
    private String pickUpCode;//提货码
    private String placeOfLoading;//开票地点
    private String sendCompany;//发货公司
    private String unloadPlace;//卸货地点
    private String receiveCompany;//到货公司
    private String receiverCompany;//收货单位
    private String userId;//用户ID
    private Boolean generateFlag;//生成货运单标识
    private String codeCompany; //
    private Double freight;//运费
    private Double priceDifference;//差额
    private Double cashOnDelivery;//货到付款
    private String sendWay;//发货方式（网点寄件/上门取件）

    private String consignerIdCard;//发货人身份证号
    private String consigneeIdCard;//收货人身份证号

    /******* 关联属性 ******/
    private int isDefaultReceiver;//是否设置为默认收货人
    private int isDefaultSender;//是否设置为默认发货人
    private int isSaveReceiver;//是否保存收货人
    private int isSaveSender;//是否保存发货人

    private String status;//状态
    private String createDate;//创建日期

    private String driverName;//提货司机
    private String predictArriveDate;//预计上门时间
private String driverTelephone;//司机姓名

    public String getDriverTelephone() {
        return driverTelephone;
    }

    public void setDriverTelephone(String driverTelephone) {
        this.driverTelephone = driverTelephone;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getPredictArriveDate() {
        return predictArriveDate;
    }

    public void setPredictArriveDate(String predictArriveDate) {
        this.predictArriveDate = predictArriveDate;
    }

    /**
     * 收货人地址经度
     */
    private Double receiverLatitude;
    /**
     * 收货人纬度
     */
    private Double receiverLongitude;

    public Double getReceiverLatitude() {
        return receiverLatitude;
    }

    public void setReceiverLatitude(Double receiverLatitude) {
        this.receiverLatitude = receiverLatitude;
    }

    public Double getReceiverLongitude() {
        return receiverLongitude;
    }

    public void setReceiverLongitude(Double receiverLongitude) {
        this.receiverLongitude = receiverLongitude;
    }

    public String getCreateDate() {
        if(createDate == null && getOrderCreateTime() != null){
            DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
            return df.format(getOrderCreateTime());
        }
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public int getIsDefaultReceiver() {
        return isDefaultReceiver;
    }

    public void setIsDefaultReceiver(int isDefaultReceiver) {
        this.isDefaultReceiver = isDefaultReceiver;
    }

    public int getIsDefaultSender() {
        return isDefaultSender;
    }

    public void setIsDefaultSender(int isDefaultSender) {
        this.isDefaultSender = isDefaultSender;
    }

    public int getIsSaveReceiver() {
        return isSaveReceiver;
    }

    public void setIsSaveReceiver(int isSaveReceiver) {
        this.isSaveReceiver = isSaveReceiver;
    }

    public int getIsSaveSender() {
        return isSaveSender;
    }

    public void setIsSaveSender(int isSaveSender) {
        this.isSaveSender = isSaveSender;
    }

    public String getConsignerIdCard() {
        return consignerIdCard;
    }

    public void setConsignerIdCard(String consignerIdCard) {
        this.consignerIdCard = consignerIdCard;
    }

    public String getConsigneeIdCard() {
        return consigneeIdCard;
    }

    public void setConsigneeIdCard(String consigneeIdCard) {
        this.consigneeIdCard = consigneeIdCard;
    }

    public String getSendWay() {
        return sendWay;
    }

    public void setSendWay(String sendWay) {
        this.sendWay = sendWay;
    }

    public void setFreight(Double freight) {
        this.freight = freight;
    }

    public void setCashOnDelivery(Double cashOnDelivery) {
        this.cashOnDelivery = cashOnDelivery;
    }

    public Double getFreight() {
        return freight;
    }

    public Double getCashOnDelivery() {
        return cashOnDelivery;
    }

    private String tenantName;//租户名称

    private Integer resource;//来源（1：小程序）

    public void setReceiverCompany(String receiverCompany) {
        this.receiverCompany = receiverCompany;
    }

    public String getReceiverCompany() {
        return receiverCompany;
    }

    public Integer getResource() {
        return resource;
    }

    public void setResource(Integer resource) {
        this.resource = resource;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public void setGoodsNumber(String goodsNumber) {
        this.goodsNumber = goodsNumber;
    }

    public void setManualNumber(String manualNumber) {
        this.manualNumber = manualNumber;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public void setPickUpWay(String pickUpWay) {
        this.pickUpWay = pickUpWay;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public void setReceiverMobile(String receiverMobile) {
        this.receiverMobile = receiverMobile;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public void setNumberOfGoods(Integer numberOfGoods) {
        this.numberOfGoods = numberOfGoods;
    }

    public void setCollectionOfMoney(Double collectionOfMoney) {
        this.collectionOfMoney = collectionOfMoney;
    }

    public void setPackageType(String packageType) {
        this.packageType = packageType;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public void setSenderMobile(String senderMobile) {
        this.senderMobile = senderMobile;
    }

    public void setSenderAddress(String senderAddress) {
        this.senderAddress = senderAddress;
    }

    public void setBankName(String bankName) {
        this.bankName = bankName;
    }

    public void setBankCardNumber(String bankCardNumber) {
        this.bankCardNumber = bankCardNumber;
    }

    public void setBankAccount(String bankAccount) {
        this.bankAccount = bankAccount;
    }

    public void setVipNumber(String vipNumber) {
        this.vipNumber = vipNumber;
    }

    public void setWeight(Double weight) {
        this.weight = weight;
    }

    public void setBulk(Double bulk) {
        this.bulk = bulk;
    }

    public void setPayWay(String payWay) {
        this.payWay = payWay;
    }

    public void setOrderCreateTime(Date orderCreateTime) {
        this.orderCreateTime = orderCreateTime;
    }

    public void setOrderUpdateTime(Date orderUpdateTime) {
        this.orderUpdateTime = orderUpdateTime;
    }

    public void setPickUpCode(String pickUpCode) {
        this.pickUpCode = pickUpCode;
    }

    public void setPlaceOfLoading(String placeOfLoading) {
        this.placeOfLoading = placeOfLoading;
    }

    public void setSendCompany(String sendCompany) {
        this.sendCompany = sendCompany;
    }

    public void setUnloadPlace(String unloadPlace) {
        this.unloadPlace = unloadPlace;
    }

    public void setReceiveCompany(String receiveCompany) {
        this.receiveCompany = receiveCompany;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setGenerateFlag(Boolean generateFlag) {
        this.generateFlag = generateFlag;
    }


    public String getOrderNumber() {
        return orderNumber;
    }

    public String getGoodsNumber() {
        return goodsNumber;
    }

    public String getManualNumber() {
        return manualNumber;
    }

    public String getTenantId() {
        return tenantId;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public String getPickUpWay() {
        return pickUpWay;
    }

    public String getReceiver() {
        return receiver;
    }

    public String getReceiverMobile() {
        return receiverMobile;
    }

    public String getReceiverAddress() {
        return receiverAddress;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public Integer getNumberOfGoods() {
        return numberOfGoods;
    }

    public Double getCollectionOfMoney() {
        return collectionOfMoney;
    }

    public String getPackageType() {
        return packageType;
    }

    public String getRemarks() {
        return remarks;
    }

    public String getSender() {
        return sender;
    }

    public String getSenderMobile() {
        return senderMobile;
    }

    public String getSenderAddress() {
        return senderAddress;
    }

    public String getBankName() {
        return bankName;
    }

    public String getBankCardNumber() {
        return bankCardNumber;
    }

    public String getBankAccount() {
        return bankAccount;
    }

    public String getVipNumber() {
        return vipNumber;
    }

    public Double getWeight() {
        return weight;
    }

    public Double getBulk() {
        return bulk;
    }

    public String getPayWay() {
        return payWay;
    }

    public Date getOrderCreateTime() {
        return orderCreateTime;
    }

    public Date getOrderUpdateTime() {
        return orderUpdateTime;
    }

    public String getPickUpCode() {
        return pickUpCode;
    }

    public String getPlaceOfLoading() {
        return placeOfLoading;
    }

    public String getSendCompany() {
        return sendCompany;
    }

    public String getUnloadPlace() {
        return unloadPlace;
    }

    public String getReceiveCompany() {
        return receiveCompany;
    }

    public String getUserId() {
        return userId;
    }

    public Boolean getGenerateFlag() {
        return generateFlag;
    }

    public Double getSenderLongitude() {
        return senderLongitude;
    }

    public void setSenderLongitude(Double senderLongitude) {
        this.senderLongitude = senderLongitude;
    }

    public Double getSenderLatitude() {
        return senderLatitude;
    }

    public void setSenderLatitude(Double senderLatitude) {
        this.senderLatitude = senderLatitude;
    }

    public String getTransferCompanyCode() {
        return transferCompanyCode;
    }

    public void setTransferCompanyCode(String transferCompanyCode) {
        this.transferCompanyCode = transferCompanyCode;
    }

    public String getTransferCompanyName() {
        return transferCompanyName;
    }

    public void setTransferCompanyName(String transferCompanyName) {
        this.transferCompanyName = transferCompanyName;
    }
    public String getSenderIdNo() {
        return senderIdNo;
    }

    public void setSenderIdNo(String senderIdNo) {
        this.senderIdNo = senderIdNo;
    }

    public String getReceiverIdNo() {
        return receiverIdNo;
    }

    public void setReceiverIdNo(String receiverIdNo) {
        this.receiverIdNo = receiverIdNo;
    }

    public String gethBackupString1() {
        return hBackupString1;
    }

    public void sethBackupString1(String hBackupString1) {
        this.hBackupString1 = hBackupString1;
    }

    public String gethBackupString4() {
        return hBackupString4;
    }

    public void sethBackupString4(String hBackupString4) {
        this.hBackupString4 = hBackupString4;
    }

    public String gethBackupString5() {
        return hBackupString5;
    }

    public void sethBackupString5(String hBackupString5) {
        this.hBackupString5 = hBackupString5;
    }

    public String gethBackupString6() {
        return hBackupString6;
    }

    public void sethBackupString6(String hBackupString6) {
        this.hBackupString6 = hBackupString6;
    }

    public String getTransportMode() {
        return transportMode;
    }

    public void setTransportMode(String transportMode) {
        this.transportMode = transportMode;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getTransportCost() {
        return transportCost;
    }

    public void setTransportCost(String transportCost) {
        this.transportCost = transportCost;
    }

    public String getTransportCostIsPay() {
        return transportCostIsPay;
    }

    public void setTransportCostIsPay(String transportCostIsPay) {
        this.transportCostIsPay = transportCostIsPay;
    }

    public String getTransportCostRefundStatus() {
        return transportCostRefundStatus;
    }

    public void setTransportCostRefundStatus(String transportCostRefundStatus) {
        this.transportCostRefundStatus = transportCostRefundStatus;
    }

    public String getTransportCostRefundMoney() {
        return transportCostRefundMoney;
    }

    public void setTransportCostRefundMoney(String transportCostRefundMoney) {
        this.transportCostRefundMoney = transportCostRefundMoney;
    }

    public String getTransportCostPayTime() {
        return transportCostPayTime;
    }

    public void setTransportCostPayTime(String transportCostPayTime) {
        this.transportCostPayTime = transportCostPayTime;
    }

    public String getTransportCostRefundTime() {
        return transportCostRefundTime;
    }

    public void setTransportCostRefundTime(String transportCostRefundTime) {
        this.transportCostRefundTime = transportCostRefundTime;
    }

    public String getPriceDifferences() {
        return priceDifferences;
    }

    public void setPriceDifferences(String priceDifferences) {
        this.priceDifferences = priceDifferences;
    }

    public String getPriceDifferencesIsPay() {
        return priceDifferencesIsPay;
    }

    public void setPriceDifferencesIsPay(String priceDifferencesIsPay) {
        this.priceDifferencesIsPay = priceDifferencesIsPay;
    }

    public String getPriceDifferencesRefundStatus() {
        return priceDifferencesRefundStatus;
    }

    public void setPriceDifferencesRefundStatus(String priceDifferencesRefundStatus) {
        this.priceDifferencesRefundStatus = priceDifferencesRefundStatus;
    }

    public String getPriceDifferencesRefundMoney() {
        return priceDifferencesRefundMoney;
    }

    public void setPriceDifferencesRefundMoney(String priceDifferencesRefundMoney) {
        this.priceDifferencesRefundMoney = priceDifferencesRefundMoney;
    }

    public String getPriceDifferencesRefundTime() {
        return priceDifferencesRefundTime;
    }

    public void setPriceDifferencesRefundTime(String priceDifferencesRefundTime) {
        this.priceDifferencesRefundTime = priceDifferencesRefundTime;
    }

    public String getPriceDifferencesPayTime() {
        return priceDifferencesPayTime;
    }

    public void setPriceDifferencesPayTime(String priceDifferencesPayTime) {
        this.priceDifferencesPayTime = priceDifferencesPayTime;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getOrderBillMasterId() {
        return orderBillMasterId;
    }

    public void setOrderBillMasterId(String orderBillMasterId) {
        this.orderBillMasterId = orderBillMasterId;
    }

    public List<PayOrder> getPayOrders() {
        return payOrders;
    }

    public void setPayOrders(List<PayOrder> payOrders) {
        this.payOrders = payOrders;
    }

    public String gethBackupMoney1() {
        return hBackupMoney1;
    }

    public void sethBackupMoney1(String hBackupMoney1) {
        this.hBackupMoney1 = hBackupMoney1;
    }

    public Double getPriceDifference() {
        return priceDifference;
    }

    public void setPriceDifference(Double priceDifference) {
        this.priceDifference = priceDifference;
    }

    @Override
    public String toString() {
        return "Order{" +
                "transportCost='" + transportCost + '\'' +
                ", transportCostIsPay='" + transportCostIsPay + '\'' +
                ", transportCostRefundStatus='" + transportCostRefundStatus + '\'' +
                ", transportCostRefundMoney='" + transportCostRefundMoney + '\'' +
                ", transportCostPayTime='" + transportCostPayTime + '\'' +
                ", transportCostRefundTime='" + transportCostRefundTime + '\'' +
                ", priceDifferences='" + priceDifferences + '\'' +
                ", priceDifferencesIsPay='" + priceDifferencesIsPay + '\'' +
                ", priceDifferencesRefundStatus='" + priceDifferencesRefundStatus + '\'' +
                ", priceDifferencesRefundMoney='" + priceDifferencesRefundMoney + '\'' +
                ", priceDifferencesRefundTime='" + priceDifferencesRefundTime + '\'' +
                ", priceDifferencesPayTime='" + priceDifferencesPayTime + '\'' +
                ", orderBillMasterId='" + orderBillMasterId + '\'' +
                ", openid='" + openid + '\'' +
                ", orderNumber='" + orderNumber + '\'' +
                ", goodsNumber='" + goodsNumber + '\'' +
                ", manualNumber='" + manualNumber + '\'' +
                ", tenantId='" + tenantId + '\'' +
                ", tenantCode='" + tenantCode + '\'' +
                ", pickUpWay='" + pickUpWay + '\'' +
                ", receiver='" + receiver + '\'' +
                ", receiverMobile='" + receiverMobile + '\'' +
                ", receiverAddress='" + receiverAddress + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", numberOfGoods=" + numberOfGoods +
                ", collectionOfMoney=" + collectionOfMoney +
                ", packageType='" + packageType + '\'' +
                ", remarks='" + remarks + '\'' +
                ", sender='" + sender + '\'' +
                ", senderMobile='" + senderMobile + '\'' +
                ", senderAddress='" + senderAddress + '\'' +
                ", senderIdNo='" + senderIdNo + '\'' +
                ", receiverIdNo='" + receiverIdNo + '\'' +
                ", transferCompanyCode='" + transferCompanyCode + '\'' +
                ", transferCompanyName='" + transferCompanyName + '\'' +
                ", hBackupString1='" + hBackupString1 + '\'' +
                ", hBackupString4='" + hBackupString4 + '\'' +
                ", hBackupString5='" + hBackupString5 + '\'' +
                ", hBackupString6='" + hBackupString6 + '\'' +
                ", transportMode='" + transportMode + '\'' +
                ", senderLongitude=" + senderLongitude +
                ", senderLatitude=" + senderLatitude +
                ", bankName='" + bankName + '\'' +
                ", bankCardNumber='" + bankCardNumber + '\'' +
                ", bankAccount='" + bankAccount + '\'' +
                ", vipNumber='" + vipNumber + '\'' +
                ", weight=" + weight +
                ", bulk=" + bulk +
                ", payWay='" + payWay + '\'' +
                ", orderCreateTime=" + orderCreateTime +
                ", orderUpdateTime=" + orderUpdateTime +
                ", pickUpCode='" + pickUpCode + '\'' +
                ", placeOfLoading='" + placeOfLoading + '\'' +
                ", sendCompany='" + sendCompany + '\'' +
                ", unloadPlace='" + unloadPlace + '\'' +
                ", receiveCompany='" + receiveCompany + '\'' +
                ", receiverCompany='" + receiverCompany + '\'' +
                ", userId='" + userId + '\'' +
                ", generateFlag=" + generateFlag +
                ", codeCompany='" + codeCompany + '\'' +
                ", freight=" + freight +
                ", cashOnDelivery=" + cashOnDelivery +
                ", sendWay='" + sendWay + '\'' +
                ", consignerIdCard='" + consignerIdCard + '\'' +
                ", consigneeIdCard='" + consigneeIdCard + '\'' +
                ", isDefaultReceiver=" + isDefaultReceiver +
                ", isDefaultSender=" + isDefaultSender +
                ", isSaveReceiver=" + isSaveReceiver +
                ", isSaveSender=" + isSaveSender +
                ", status='" + status + '\'' +
                ", createDate='" + createDate + '\'' +
                ", tenantName='" + tenantName + '\'' +
                ", resource=" + resource +
                '}';
    }
}
